#include "junix.h"

struct A
{
	char c;
	int  i;
	short s;
	long long ll;
};

int main(int argc, char **argv)
{
	printf("\
			struct A\n\
			{\n\
			char c;\n\
			int  i;\n\
			short s;\n\
			long long ll;\n\
			};\n\n"
		  );
	printf("c:  %d\ni:  %d\ns:  %d\nll: %d\n",
			offsetof(struct A,c),
			offsetof(struct A,i),
			offsetof(struct A,s),
			offsetof(struct A,ll) );

	struct A a={'a',1234,4321,12345678};

	printf("%c\n%u\n%u\n",//%d\n%d\n%u\n",
		   *(char*)(&a+offsetof(struct A,c)), 
		   *(int*)(&a+offsetof(struct A,i)),
		   *(short*)(&a+offsetof(struct A,s))
		   );


	return 0;
}

